package com.jsshse.dao.base.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.jsshse.dao.base.BaseDaoI;

@Repository("baseDao")
public class BaseDaoImpl<T> implements BaseDaoI<T> {
	@Resource(name = "sqlMapClientTemplate")
	private SqlMapClientTemplate sqlTemp;

	public List queryBySqlText(String sqlText) {
		return sqlTemp.queryForList("sys.queryList", sqlText);
	}

	public int queryCnt(String sqlText) {
		return ((Integer) sqlTemp.queryForObject("sys.queryCnt", sqlText)).intValue();
	}
	
	public List queryForList(Object paramCls, int startRow, int pageRows) {
		return  sqlTemp.queryForList("sys.queryList", paramCls, startRow, pageRows);
	}

	public SqlMapClientTemplate getSqlTemp() {
		return sqlTemp;
	}
 
	public List<T> queryForListByPage(Object param, int s, int p) {
		// TODO Auto-generated method stub
		return null;
	}

	
	public int queryForListCnt(Object param) {
		// TODO Auto-generated method stub
		return 0;
	}

	public boolean add(Map o) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean delete(String o) {
		// TODO Auto-generated method stub
		return false;
	}

 
	public boolean update(Map o) {
		// TODO Auto-generated method stub
		return false;
	}

 
	public Map queryById(String o) {
		// TODO Auto-generated method stub
		return null;
	}

}
